var Viewport = function(){
	var menuHome = {
	    	xtype: "buttongroup",
	    	title: " ",
	    	padding:"5 5 5 5",
	        bodyStyle:"min-height:25px",
	    	items: [
		        {
		        	//xtype: "splitbutton",
		        	text: "Inicio",
		        	iconCls: Asg.constants.HOME_ICON,
		        	menuAlign: "tr-bl",
		        	//split: true,
		        	iconAlign: "left",
		        	handler: function(){
		        		document.location.href = Asg.constants.CONTEXT_PATH + "/home";
	    			}/*,
		        	menu: [
						{
							text: "Clientes / Poliza",
							handler: function(){document.location.href = Asg.constants.CONTEXT_PATH + "/seguros/view";}
						},{
							text: "Abonos",
							handler: function(){document.location.href = Asg.constants.CONTEXT_PATH + "/abonos/view";}
						},{
							text: "Pendientes",
							handler: function(){document.location.href = Asg.constants.CONTEXT_PATH + "/pendientes/view";}
						},{
							text: "Reclamos",
							handler: function(){document.location.href = Asg.constants.CONTEXT_PATH + "/reclamos/view";}
						},{
							text: "Renovaciones",
							handler: function(){document.location.href = Asg.constants.CONTEXT_PATH + "/renovaciones/view";}
						}
	    	        ]*/
	        	}
	        ]
	    };
		return{
		getMenuHome: function(){return menuHome;},
		clock: function(){
			var task = {
					run: function(){
							Ext.fly("clock").update(Ext.Date.format(new Date(), "d/m/Y h:i:s A"));
					},
					interval: 1000
			};
			Ext.TaskManager.start(task);
		},
		initWindow: function(config){
			//this.clock();
			if(!config || !config.items){
				config = {
					items: {
						border: false,
						html: "RECURSO NO DISPONIBLE",
						flex: 1
					}
				};
			} 
			new Ext.Viewport({
				id: "viewport",
				layout: "border",
				minWidth: 1000,
				minHeight: 600,
				items: [
			        {
			        	xtype: "container",
			        	contentEl: "header",
						region: "north",
						height: 50,
						border: false,
						cls: "header"
			        },{
			        	region: "center",
			        	margins: "0 5 5 5 ",
			        	border: false,
			        	bodyStyle: "background: #DFE8F6; border: none !important;",
			        	frame:false,
						layout: {
							type: "vbox",
							align : "stretch",
							pack  : "start"
						},
			        	items: config.items,
			        	tbar: {
                            xtype: "toolbar",
                            hidden: !config.menu || config.menu.length == 0,
                            items: config.menu || [],
                            bodyStyle: "border: none;",
                            style: "border: none;"
                        }
			        }
		        ]
			});
		}
	};
}();